Repository navigation
fix(quota): preserve planning writeback lease scope - #9150
Conversation
Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]>
Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]>
4de7dd5 to
8859b01
Compare
cocolord
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; GPT-6; OpenAI; self_reported
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
APPROVE — exact head 8859b01fe69c531d3d114bb6187b6e6e76fe4d71。未发现本切片的阻塞缺陷;整体 RFC、原生采用和合入门仍开放。
动机
已获准非交付规划复核、随后需要写回的 Agent。 同一 Todo 的规划复核已获准,guard 本来不准备业务执行租约,旧写回却要求该租约并反复拒绝;现在只对原 receipt 正准入的非交付复核跳过业务 lease 读取,实际执行继续要求原证明。 规划可沿原 Turn 完成语义写回,Todo 和 lease 不被执行或完成;反馈 reader 沿原结果读回并保持一次扣额。 本 PR 不新增决策 owner、RPC 或自动激活,不放宽显式/已准备执行租约,不将脚本反馈当作模型采用或收益。 整体入口迁移、安装态切换、实际模型采用、独立成果及完整成本比较仍需后续原验收。
改动思路
只消费既有 typed receipt 的正准入事实,保留 source locks、Goal Stop 与显式/已准备 execution gate;反馈资格读取原 immutable reader,不补造或重复 settlement。 当前 PR 修复非交付规划到写回的真实组合及反馈资格 reader;原工作权限、验收与整体 RFC 缺口继续保留。 正路径是 Original receipt admits planning with no active execution lease; same identity writes once, replay has no extra effects and Todo/lease are unchanged. 负路径是 Foreign Turn, explicit lease request or prepared execution without original proof refuses; stopped Goal refuses; unvalidated continuing Todo cannot terminate. 原事实与 effect owner 继续维护身份、权限和结算,新的投影不构成执行授权。做更小的 wrapper 而保留正常规则会继续产生两个需同步修改的位置;另建执行 owner 则没有证据支持。此处复用既有 owner 并保留必要 IO,是可独立回滚的边界。
具体改动
6 个文件。唯一生产改动在 execution_preparation.py,现有 lease 检查整体留在非 planning 分支;新增12种 File/SQLite规划边界,四个历史手动 caller 带原 guard proof。既有9项 feedback qualification 改为原结果详情读取并继续执行完整链;双语 RFC 记录不同扣额 owner 和开放验收。
规格依据:docs/architecture/rfcs/mechanism-convergence-and-learning-loop-v0.md,预变更规范 revision 11cc41c36ed72a9aa75202458d66930a5ac4ba25。criterion 5.5:当前规则/真实 caller 迁移 implemented;8:原身份、receipt 与 pending recovery implemented;9:本切片的合法/拒绝/恢复与一次结算控制 implemented;10:整体采用及成果/完整成本要求 deferred,沿原 C1/C4/C9 与安装/效果验收继续。checkpoint 编辑不反向定义这些 oracle。
关键代码讲解
guard_first_writeback_execution 不根据 task 文本猜测规划;它从 typed readback 的 replan_execution_pending 派生 planning_only,source lock 与 Stop 对该路径仍强制。原 hard lease proof/epoch/completion receipt 检查没有删除。test_feedback_checkpoint_reaches_next_actual_experiment 读取仅 /json_path,再验证原持久化 Vision;普通 settlement 的 debit 由 runtime 返回,规划 checkpoint 按自己的返回命令执行,不能混为同一路径。
实际调用链:refresh-state -> guard_first_writeback_execution; settlement readback -> receipt-admitted autonomous replan; existing feedback checkpoint -> result_details context-read。保留的兼容边界:Explicit/current prepared lease read, retired-proof recovery, source lock/Stop, original validation and debit owners; unchanged public schema. 退役边界:Only the unsupported business-execution precondition on positively admitted non-delivery review is removed; no parallel receipt rule added.
对主干的风险
最强反例是把规划许可当作执行许可,绕过硬租约或 Stop。新增路径须同时满足原 typed receipt 正准入、未准备执行且无显式 proof;外国 Turn、prepared execution、explicit proof 和 Stop 都通过真实 CLI 负例验证。reader 修复不能只删除旧断言:仍检查原 Run/Vision、replay identity、一次普通 debit、规划另一次 debit及未验收 terminal refusal。 回滚应撤回本切片而保留原 journal/receipt 和恢复身份,不能通过新 Turn 或补扣额掩盖旧未完成工作。新增代码没有不同的 peer/权限模型,状态判定复用 typed route、receipt 和 schema;不依赖任务文本判断状态。能力安装与 RPC 可用均不触发新激活。
PASS:21 current scope/feedback CLI cases plus retained 16 execution/planning cases, current nine full followthrough cases and composed-head nine cases; source File/SQLite with off/enabled strategy and hard/soft claim. 原失败和 mutation:Immutable base reproduces original planning lease refusal; old inline json_path consumer fails on fixed main; repaired reader without runtime repair reaches the lease refusal; current complete nine-case flow passes. CI 当前仍有未完成或失败的诊断项,原因未全部核实;独立检查覆盖本次受影响 invariant,CI 颜色不能代替这些证据,也不能被改叫全绿。
语义与 CI 对齐
复用已有共享词汇,局部类型表达原值,未新增持久化 schema 或独立状态 owner。公开/native codec 与拒绝顺序保留;源规范、双语 staged/exact-head gates 和已有风险 premerge 证据已核对。原生隔离控制在 immutable main 亦于同一入口失败,组合原生采用仍 UNVERIFIED;这是整体资格缺口,未被局部 CLI pass 覆盖。PG 普通 Host Turn、已安装切换、真实模型采用与成果/完整成本不由本切片测试证明。
我的整体评价
本 PR 是 justified_increment。当前 PR 修复非交付规划到写回的真实组合及反馈资格 reader;原工作权限、验收与整体 RFC 缺口继续保留。 长程义务 preserved,用户入口 improved,合法规划不再被不适用的业务 lease 阻断。无渲染 App/Lark 页面变化,visual_review not_applicable。保持历史 codec/receipt 的代价有实际消费者依据;当前已减去正常重复规则,不为减少行数删除必要 IO。整体入口迁移、安装态切换、实际模型采用、独立成果及完整成本比较仍需后续原验收。 没有阻塞代码 finding;最强仍缺验证是安装态与真实模型/独立成果采用。审批结论只针对此 unchanged head,不授予 merge 或清除 CI/整体验收 gate。
English verdict: APPROVE - 8859b01; existing owner reused, scoped real File/SQLite positive/refusal/recovery checks pass; installed/native adoption and full outcome/cost acceptance remain open, and CI/merge holds remain separate.
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEADFor a same-repository clone whose Keep the DCO |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
已经获准做 Todo 绑定规划复核的 Agent,需要把这个原 Turn 的结论写回。 在目标分支快照和实际合并基线 11cc41c,File 与 SQLite 的四种规划条件均会因缺业务租约而拒绝写回。 当前头的四种规划组合完成原身份写回与一次扣额,重放后扣额不变,Todo 和租约逐项相同。 本次修复保留原规划权限与执行护栏。部署版和实际模型后续采用留给独立验收。
改动思路 / Approach
现有 TypeScript receipt 提供肯定的规划准入事实,Python 写回只消费这个事实。 只有原 Turn 的非交付规划在未请求、未准备执行时走这个分支。 反馈测试从原结算的不可变详情读回路径,正常结算由原运行时扣额,规划按返回动作核对应有的扣额。 两条路径均复用原有来源和相同身份。
具体改动 / Changes
审查提交 8859b01,基线 dcf208c。6 个文件,+193/-49。机制 RFC 的原身份结算、执行与 Stop由原生入口实测核对。
关键代码讲解
guard_first_writeback_execution 保留运行锁与 Stop,并按原凭证判定规划。测试覆盖两个后端、两个规划策略和八组拒绝。 写回护栏 CLI 反例
新路径复用原有来源和类型判断,测试通过常规入口观察完整结果。生产代码没有另建来源、写回或结果状态。旧记录继续由原接口读取,验收仍依据原始任务和当前头的证据。成对 RFC 记录此处可验证的边界与后续采用范围。
对主干的风险 / Risks
无阻断发现。跨 Turn、显式租约请求、已准备执行、Goal Stop 在两个本地数据后端的八组负例均拒绝写回,保持零扣额。 目标分支快照与实际合并基线上的四组规划夹具均被原租约检查拒绝,当前两份本地套件 21 项通过。快速预合入的 6 项直接与 4 项选定检查通过。 保留当前头的测试事实和原有拒绝条件。远端 CI 未查询。当前平台合入存在冲突,仍须独立解决。
我的整体评价 / Verdict
批准本次切片。原始结果和权威保持可追溯。实际运行时采用及后续成果仍需用现有工作流核查。当前变更在 Core 写回护栏和测试,无渲染界面。 正式安装、真实模型采用与最终收益未在本轮测试。
English verdict: APPROVE at 8859b01. Receipt-admitted planning settles once while business execution and Stop remain fenced.
Signed-off-by: LoopX Agent <[email protected]>
A Todo-bound autonomous review could be admitted for planning and then fail every writeback retry: the guard deliberately prepares no business execution lease, while refresh required one for the selected Todo. The adapter now consumes the existing typed receipt owner's positive non-delivery admission and retains the original proof requirement for explicit or previously prepared execution. Planning still holds source locks and checks Goal Stop; it neither executes nor completes the selected Todo.
The existing feedback qualification now follows the current settlement reading contract. It reads the original Run path through the immutable
result_detailsreader, checks a combined settlement's runtime-owned debit and original-identity replay, and follows the planning checkpoint's separately returned agent-owned spend command. The original feedback, independently checked route cost, negative closeout and durable once-only assertions remain.同一 Todo 的非交付复核已获准,却因未准备业务执行租约而无法写回。本变更复用既有 TypeScript receipt 的正准入事实,规划路径保留源锁和 Stop,显式或先前准备的执行继续要求原证明。反馈资格消费者也改用原结果的不可变详情读取,分别沿正常组合结算与规划复核的返回合同检查扣额,不新增执行、权限或决策 owner。
The same-domain refactoring shares the existing source/Goal check. It adds no schema, activation, scheduler, parallel executor or runtime RPC. The bilingual mechanism checkpoint preserves remaining installation, migration, model-adoption and outcome/full-cost acceptance.
Validation
Exact head:
8859b01fe69c531d3d114bb6187b6e6e76fe4d71. Verified targetmain:11cc41c36ed72a9aa75202458d66930a5ac4ba25.b25b10def4e2ae41218dbaab287e98c5d2a6de9ereproduces the original lease refusal. The existing feedback consumer also fails at main1a3ab75a53107b29ee1b8bff56e2b8263259dec6on its removed inlinejson_path. After the read-only consumer repair, current main without this runtime fix reaches the original planning lease refusal. These failures are retained.The earlier broad run reported 156 passes, four stale-caller failures and 10 Windows-only skips; the corrected four controls passed at both their immutable base and candidate. This is not a new full-tree rerun. No active Goal, registry, fence or lease was used as test data.
Boundary and remaining acceptance
The existing native exception, exact identity, ordinary execution proof, source lock, Goal Stop and settlement owners remain. PostgreSQL authority/schema are unchanged; local File/SQLite checks do not qualify an ordinary PostgreSQL Host Turn. Installed cutover, actual model adoption, independent outcomes, comparable complete costs and the remaining whole-RFC implementation remain open. EdgeBench remains later evaluation. This PR has no UI/default activation change and grants no merge authority.